<?php
if (!$this->enableRegistration) {
	print "Registration is disabled";
	return;
}
$form = $this->registerForm;
$formmsg = $form->getMessages();
if(!empty($formmsg))  {
	echo $this->helper()->makeFlashMsg(array('text'=>"Enregistrement échouée, veuillez bien remplir le formulaire", 'type'=>'error'));
}
$form->get('submit')->setValue('Enrgistrer')->setAttribute('class', 'btn');
?>
<form
	action="<?php echo $this->url('user', array('action'=>'register'));?>"
	method="post">
	<fieldset>
		<legend>Créer un compte</legend>
		<div class="row-fluid">
			<fieldset class="span9">
				<div
					class="control-group <?php if(!empty($formmsg['email'])) echo 'error'?>">
					<?php 
					echo $this->formLabel($form->get('email'));
					echo $this->formElement($form->get('email'));
					echo $this->formElementErrors($form->get('email'));
					?>
				</div>
				<div
					class="control-group <?php if(!empty($formmsg['password'])) echo 'error'?>">
					<?php 
					echo $this->formLabel($form->get('password'));
					echo $this->formElement($form->get('password'));
					echo $this->formElementErrors($form->get('password'));
					?>
				</div>
				<div
					class="control-group <?php if(!empty($formmsg['passwordVerify'])) echo 'error'?>">
					<?php 
					echo $this->formLabel($form->get('passwordVerify'));
					echo $this->formElement($form->get('passwordVerify'));
					echo $this->formElementErrors($form->get('passwordVerify'));
					?>
				</div>
				<div>
					<?php if ($this->redirect) { ?>
					<input type="hidden" name="redirect"
						value="<?php echo $this->redirect ?>" />
					<?php } ?>
				</div>
			</fieldset>
		</div>
		<fieldset class="form-actions">
			<?php echo $this->formSubmit($form->get('submit')) ?>
			<?php if ($this->enableRegistration) { ?>
			Déjà membre ? <a
				href="<?php echo $this->url('zfcuser/login') . ($this->redirect ? '?redirect='.$this->redirect : '') ?>">Connexion</a>
			<?php } ?>
		</fieldset>
	</fieldset>